<template>
    <div>
        资源走丢了{{time}}
    </div>
</template>
<script>
export default {
    data(){
        return {
            time:3,
            timer:null
        }
    },
    created(){
        this.timer = setTimeout(() => {
            clearTimeout(this.timer);  //['/look/song','/look/story','/login']
            this.$router.replace('/');
        },this.time*1000)
    },
    beforeDestroy(){
        this.timer && clearTimeout(this.timer);
    }
}
</script>
